'''
工资结算
'''
from abc import ABCMeta,abstractmethod
class Employee(metaclass=ABCMeta):
    def __init__(self,name):
        self.name = name
    @abstractmethod
    def get_salary(self):
        pass
class Manager(Employee):
    def get_salary(self):
        return 12000
class Programer(Employee):
    def __init__(self,name):
        super().__init__(name)
        hours = 0
    def get_salary(self):
        return 200 * self.hours
class SalesMan(Employee):
    def __init__(self,name):
        super().__init__(name)
        self.sales = 0
    def get_salary(self):
        return 1800 + self.sales
def main():
    '''
    主函数
    '''
    emps = [Manager('阿波清'),Manager("阿波情"),Programer("林肖"),Programer("何鑫"),SalesMan("bb")]
    for emp in emps:
        if isinstance(emp,Programer):
            emp.hours = int(input("input working_hours,please:"))
            print(f'{emp.name}的工资是{emp.get_salary()}')

        if isinstance(emp,SalesMan):
            emp.sales = int(input("input sales please:"))
            print(f'{emp.name}的工资是{emp.get_salary()}')
        print(f'{emp.name}的工资是{emp.get_salary()}')
        
if __name__ == "__main__":
    main()

